﻿using Charades.Web.Models;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;

namespace Charades.Web.Hubs
{
	using Charades.Web.Server;
	using Microsoft.AspNet.SignalR;

	public abstract class BaseHub : Hub
	{
		protected BaseHub()
		{
			Game = Game.Instance;
			UserManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
		}

		public Game Game { get; set; }

		public UserManager<ApplicationUser> UserManager { get; private set; }

		public void Ping(dynamic message)
		{
			Clients.All.Pong(message);
		}
	}
}